package api

import (
	"fmt"
	"hft/tools/weixin"
	"hft/tools/weixin/model"
	"net/url"

	jsoniter "github.com/json-iterator/go"
)

type Menu struct{}

// 创建接口
func (*Menu) CreateMenu(menuTree *model.CustomMenu) (err error) {
	config := jsoniter.Config{
		EscapeHTML: false, //进制html转移
	}
	data, _ := config.Froze().Marshal(&menuTree)
	res := weixin.WeiXinBase.BaseRequestV2("POST", "/cgi-bin/menu/create", &url.Values{}, data)

	fmt.Println(string(res), "结果")

	return nil
}

var WeiXinMenu = new(Menu)
